package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@Controller
@ResponseBody
@RequestMapping("/user")
public class loginController {
    @RequestMapping("/login")
    public HashMap<String,Object> login(String username, String password) {
        HashMap<String,Object> res = new HashMap<>();
        int succ = 200;
        if(username!=null && password !=null && username.equals("admin") && password.equals("admin")) {
            res.put("msg","登录成功");
        } else {
            res.put("msg","登录失败");
        }
        res.put("succ",succ);
        return res;
    }
}
